﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

namespace FinalProject
{
    public class ClsConnection
    {
        SqlConnection cnn = new SqlConnection(ConfigurationSettings.AppSettings["pstrConnectionString"]);
        public void openConnection()
        {
            cnn.Open();
            /*
            SqlCommand thisCommand = cnn.CreateCommand();
            thisCommand.CommandText = "SELECT UserGroupID, Password FROM UMS_tblUserAccount";
            SqlDataReader thisReader = thisCommand.ExecuteReader();
            while (thisReader.Read())
            {
                Console.WriteLine("\t{0}\t{1}", thisReader["UserGroupID"], thisReader["Password"]);
            }
            thisReader.Close();
            cnn.Close();             
            */
        }

        public void closeConnection()
        {
            cnn.Close();
        }
        
        public SqlCommand getSqlCommand()
        {
            return cnn.CreateCommand();
        }
    }
}

//<asp:UpdatePanel ID="UpdatePanel1" runat="server">
//    <ContentTemplate>
//  </ContentTemplate>
//    </asp:UpdatePanel>